package org.graduation.model.common.IM;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class GroupMessage implements SocketMessageType, Serializable {
    private final static long serialVersionUID = 113213L;
    private final static String MESSAGE_TYPE = "GROUP";
    @JsonSerialize(using = ToStringSerializer.class)
    private Long groupId;
    @JsonSerialize(using = ToStringSerializer.class)
    private Integer fromUid;
    private String message;
    private Date time;

    @Override
    public String getMessageType() {
        return MESSAGE_TYPE;
    }
}
